/*
 * BalancedBinaryTree.h
 *
 *  Created on: 07/07/2012
 *      Author: marcio
 */

#ifndef BALANCEDBINARYTREE_H_
#define BALANCEDBINARYTREE_H_

typedef struct _binarynode{
	void* elem;
	struct _binarynode* right;
	struct _binarynode* left;
	int lvl;
}BalancedBinaryTreeNode;

typedef struct _tree{
	BalancedBinaryTreeNode* root;
	int height;
	int size;
}BalancedBinaryTree;

BalancedBinaryTreeNode* balancedbinarytreenode_newNode(void* elem);

int balancedbinarytreenode_addToRight(BalancedBinaryTreeNode* root, BalancedBinaryTreeNode* newnode);

int balancedbinarytreenode_addToLeft(BalancedBinaryTreeNode* root, BalancedBinaryTreeNode* newnode);

BalancedBinaryTree* balancedbinarytree_newBalancedBinaryTree(, int (*choice)(void*, void*));

int tree_getSize(BalancedBinaryTree* b);

BalancedBinaryTreeNode* balancedbinarytree_getRoot(BalancedBinaryTree* b);

int balancedbinarytree_addNode(BalancedBinaryTree* b, BalancedBinaryTreeNode* newnode);

BalancedBinaryTreeNode** balancedbinarytree_BFS(BalancedBinaryTree* b);

BalancedBinaryTreeNode** balancedbinarytree_DFS(BalancedBinaryTree* b);

BalancedBinaryTreeNode** balancedbinarytree_BFSOnlyLeafs(BalancedBinaryTree* b);

BalancedBinaryTreeNode** balancedbinarytree_DFSOnlyLeafs(BalancedBinaryTree* b);

int balancedbinarytree_BFSModify(BalancedBinaryTree* b,int (f)(void*));

int balancedbinarytree_DFSModify(BalancedBinaryTree* b,int (f)(void*));

int balancedbinarytree_delete(BalancedBinaryTree* b);

#endif /* BALANCEDBINARYTREE_H_ */
